<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Axios学习</title>
</head>
<body>
<div id="app">
    <h1>{{message}}</h1>
    <table width="250px" border="1px">
        <tr v-for="stu in students">
            <td>{{stu.name}}</td>
            <td>{{stu.age}}</td>
            <td>{{stu.sex}}</td>
        </tr>
    </table>
</div>
<script src="lib/vue.js"></script>
<script src="lib/axios.min.js"></script>
<script>
    new Vue({
        el: "#app",
        data: {
            message: "Axios简单案例",
            students: []
        },
        methods: {
            list() {
                axios.get("http://localhost:63342/Axios-Learning/Axios-Learning/data/students.json").then(responseData => {
                    this.students = responseData.data.students;
                    return axios.get("http://localhost:63342/Axios-Learning/Axios-Learning/data/students.json");
                }).then(responseData => {
                    console.log("responseData:", JSON.stringify(responseData));
                })
            }
        },
        created() {
            this.list();
        }
    })
</script>
</body>
</html>